import { createRouter, createWebHistory } from 'vue-router'
import { defineAsyncComponent } from 'vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  BASE_URL:'/',
  routes: [
    {
      path: '/',
      name: 'home',
      component: () => import('../views/Home.vue')
    },
    {
      path: '/search',
      name: 'search',
      component: () => import('../views/SearchPage.vue')
    },
    {
      path: '/publish',
      name: 'publish',
      component: () => import('../views/PublishPage.vue')
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/LoginPage.vue')
    },
    {
      path: '/myPublish',
      name: 'myPublish',
      component: () => import('../views/MyPublishPage.vue')
    },
    {
      path: '/userCenter',
      name: 'userCenter',
      component: () => import('../views/UserCenter.vue')
    },
    // 移动端
    {
      path: '/mobileHome',
      name: 'mobileHome',
      component: () => import('../views/mobileView/MobileHome.vue')
    },
    {
      path: '/practiceDetailMobile',
      name: 'practiceDetailMobile',
      component: () => import('../views/mobileView/PracticeDetail.vue')
    },
  ]
})

export default router
